<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <title>剑指offer第二周 - Even - A super concise theme for Hugo</title>
  <meta name="renderer" content="webkit" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>

<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />

<meta name="theme-color" content="#f8f5ec" />
<meta name="msapplication-navbutton-color" content="#f8f5ec">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="#f8f5ec">


<meta name="author" content="olOwOlo" /><meta name="description" content="机器人的运动范围 题意： ​ 一个矩阵，机器人在原点走k步，问机器人可以到达的点。bfs问题 代码(bfs队列中，先判断t这个点是不是合法，然后开始" /><meta name="keywords" content="Hugo, theme, even" />






<meta name="generator" content="Hugo 0.83.1 with theme even" />


<link rel="canonical" href="https://xiongshou.github.io/post/%E7%AC%AC%E4%BA%8C%E5%91%A8/" />
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/manifest.json">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">



<link href="/sass/main.min.f92fd13721ddf72129410fd8250e73152cc6f2438082b6c0208dc24ee7c13fc4.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.1.20/dist/jquery.fancybox.min.css" integrity="sha256-7TyXnr2YU040zfSP+rEcz29ggW4j56/ujTPwjMzyqFY=" crossorigin="anonymous">


<meta property="og:title" content="剑指offer第二周" />
<meta property="og:description" content="机器人的运动范围 题意： ​ 一个矩阵，机器人在原点走k步，问机器人可以到达的点。bfs问题 代码(bfs队列中，先判断t这个点是不是合法，然后开始" />
<meta property="og:type" content="article" />
<meta property="og:url" content="https://xiongshou.github.io/post/%E7%AC%AC%E4%BA%8C%E5%91%A8/" /><meta property="article:section" content="post" />
<meta property="article:published_time" content="2021-06-01T20:16:50&#43;09:00" />
<meta property="article:modified_time" content="2021-06-01T20:16:50&#43;09:00" />

<meta itemprop="name" content="剑指offer第二周">
<meta itemprop="description" content="机器人的运动范围 题意： ​ 一个矩阵，机器人在原点走k步，问机器人可以到达的点。bfs问题 代码(bfs队列中，先判断t这个点是不是合法，然后开始"><meta itemprop="datePublished" content="2021-06-01T20:16:50&#43;09:00" />
<meta itemprop="dateModified" content="2021-06-01T20:16:50&#43;09:00" />
<meta itemprop="wordCount" content="1809">
<meta itemprop="keywords" content="剑指offer," /><meta name="twitter:card" content="summary"/>
<meta name="twitter:title" content="剑指offer第二周"/>
<meta name="twitter:description" content="机器人的运动范围 题意： ​ 一个矩阵，机器人在原点走k步，问机器人可以到达的点。bfs问题 代码(bfs队列中，先判断t这个点是不是合法，然后开始"/>

<!--[if lte IE 9]>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/classlist/1.1.20170427/classList.min.js"></script>
<![endif]-->

<!--[if lt IE 9]>
  <script src="https://cdn.jsdelivr.net/npm/html5shiv@3.7.3/dist/html5shiv.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/respond.js@1.4.2/dest/respond.min.js"></script>
<![endif]-->

</head>
<body>
  <div id="mobile-navbar" class="mobile-navbar">
  <div class="mobile-header-logo">
    <a href="/" class="logo">Even</a>
  </div>
  <div class="mobile-navbar-icon">
    <span></span>
    <span></span>
    <span></span>
  </div>
</div>
<nav id="mobile-menu" class="mobile-menu slideout-menu">
  <ul class="mobile-menu-list">
    <a href="/">
        <li class="mobile-menu-item">Home</li>
      </a><a href="/post/">
        <li class="mobile-menu-item">Archives</li>
      </a><a href="/tags/">
        <li class="mobile-menu-item">Tags</li>
      </a><a href="/categories/">
        <li class="mobile-menu-item">Categories</li>
      </a><a href="/about/">
        <li class="mobile-menu-item">About</li>
      </a>
  </ul>

  


</nav>

  <div class="container" id="mobile-panel">
    <header id="header" class="header">
        <div class="logo-wrapper">
  <a href="/" class="logo">Even</a>
</div>





<nav class="site-navbar">
  <ul id="menu" class="menu">
    <li class="menu-item">
        <a class="menu-item-link" href="/">Home</a>
      </li><li class="menu-item">
        <a class="menu-item-link" href="/post/">Archives</a>
      </li><li class="menu-item">
        <a class="menu-item-link" href="/tags/">Tags</a>
      </li><li class="menu-item">
        <a class="menu-item-link" href="/categories/">Categories</a>
      </li><li class="menu-item">
        <a class="menu-item-link" href="/about/">About</a>
      </li>
  </ul>
</nav>

    </header>

    <main id="main" class="main">
      <div class="content-wrapper">
        <div id="content" class="content">
          <article class="post">
    
    <header class="post-header">
      <h1 class="post-title">剑指offer第二周</h1>

      <div class="post-meta">
        <span class="post-time"> 2021-06-01 </span>
        <div class="post-category">
            <a href="/categories/%E5%89%91%E6%8C%87offer/"> 剑指offer </a>
            </div>
        
      </div>
    </header>

    <div class="post-toc" id="post-toc">
  <h2 class="post-toc-title">Contents</h2>
  <div class="post-toc-content always-active">
    <nav id="TableOfContents">
  <ul>
    <li><a href="#机器人的运动范围">机器人的运动范围</a>
      <ul>
        <li><a href="#题意">题意：</a></li>
        <li><a href="#代码bfs队列中先判断t这个点是不是合法然后开始转移再判断转移的点是不是合法">代码(bfs队列中，先判断t这个点是不是合法，然后开始转移，再判断转移的点是不是合法)</a></li>
      </ul>
    </li>
    <li><a href="#剪绳子">剪绳子</a>
      <ul>
        <li><a href="#题意-1">题意</a></li>
        <li><a href="#思路">思路：</a></li>
        <li><a href="#证明">证明：</a></li>
        <li><a href="#代码">代码</a></li>
      </ul>
    </li>
    <li><a href="#二进制中1的个数">二进制中1的个数</a>
      <ul>
        <li><a href="#代码-1">代码</a></li>
      </ul>
    </li>
    <li><a href="#数值的整数次方">数值的整数次方</a>
      <ul>
        <li><a href="#思路-1">思路：</a></li>
        <li><a href="#代码-2">代码：</a></li>
      </ul>
    </li>
    <li><a href="#o1时间删除链表节点">O(1)时间删除链表节点</a>
      <ul>
        <li><a href="#思路-2">思路；</a></li>
        <li><a href="#代码-3">代码：</a></li>
      </ul>
    </li>
    <li><a href="#删除链表中重复的节点">删除链表中重复的节点</a>
      <ul>
        <li><a href="#思路-3">思路：</a></li>
        <li><a href="#代码-4">代码</a></li>
      </ul>
    </li>
    <li><a href="#正则表达式匹配">正则表达式匹配</a>
      <ul>
        <li><a href="#题意-2">题意：</a></li>
        <li><a href="#思路-4">思路</a></li>
        <li><a href="#写法">写法</a></li>
        <li><a href="#代码-5">代码</a></li>
      </ul>
    </li>
    <li><a href="#调整数组顺序使奇数位于偶数前面">调整数组顺序使奇数位于偶数前面</a>
      <ul>
        <li><a href="#代码直接用i-j指针while">代码:直接用i ，j指针+while</a></li>
      </ul>
    </li>
    <li><a href="#链表中倒数第k个节点">链表中倒数第k个节点</a>
      <ul>
        <li><a href="#代码-6">代码</a></li>
      </ul>
    </li>
    <li><a href="#链表中环的起点">链表中环的起点</a>
      <ul>
        <li><a href="#题意-3">题意</a></li>
        <li><a href="#思路-5">思路</a></li>
        <li><a href="#代码-7">代码</a></li>
      </ul>
    </li>
  </ul>
</nav>
  </div>
</div>
    <div class="post-content">
      <h1 id="机器人的运动范围">机器人的运动范围</h1>
<h2 id="题意">题意：</h2>
<p>​		一个矩阵，机器人在原点走k步，问机器人可以到达的点。bfs问题</p>
<h2 id="代码bfs队列中先判断t这个点是不是合法然后开始转移再判断转移的点是不是合法">代码(bfs队列中，先判断t这个点是不是合法，然后开始转移，再判断转移的点是不是合法)</h2>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre class="chroma"><code><span class="lnt"> 1
</span><span class="lnt"> 2
</span><span class="lnt"> 3
</span><span class="lnt"> 4
</span><span class="lnt"> 5
</span><span class="lnt"> 6
</span><span class="lnt"> 7
</span><span class="lnt"> 8
</span><span class="lnt"> 9
</span><span class="lnt">10
</span><span class="lnt">11
</span><span class="lnt">12
</span><span class="lnt">13
</span><span class="lnt">14
</span><span class="lnt">15
</span><span class="lnt">16
</span><span class="lnt">17
</span><span class="lnt">18
</span><span class="lnt">19
</span><span class="lnt">20
</span><span class="lnt">21
</span><span class="lnt">22
</span><span class="lnt">23
</span><span class="lnt">24
</span><span class="lnt">25
</span><span class="lnt">26
</span><span class="lnt">27
</span><span class="lnt">28
</span><span class="lnt">29
</span><span class="lnt">30
</span><span class="lnt">31
</span><span class="lnt">32
</span><span class="lnt">33
</span><span class="lnt">34
</span><span class="lnt">35
</span><span class="lnt">36
</span><span class="lnt">37
</span><span class="lnt">38
</span><span class="lnt">39
</span><span class="lnt">40
</span><span class="lnt">41
</span><span class="lnt">42
</span><span class="lnt">43
</span><span class="lnt">44
</span></code></pre></td>
<td class="lntd">
<pre class="chroma"><code class="language-fallback" data-lang="fallback">class Solution {
public:
    int movingCount(int threshold, int rows, int cols)
    {
        if (!rows || !cols) return 0;
        int res=0;
        queue&lt;pair&lt;int,int&gt; &gt;q;
        q.push({0,0});
        vector&lt;vector&lt;bool&gt;&gt; book(rows, vector&lt;bool&gt;(cols, false));      
        int dx[4]={-1,0,1,0},dy[4]={0,1,0,-1};
        while(q.size())
        {
            auto t=q.front();
            q.pop();
            int x=t.first,y=t.second;
            if(book[x][y]) continue;
            
            if(getsum(x) + getsum(y) &gt;threshold) continue;
            //cout&lt;&lt;x&lt;&lt;&#39; &#39;&lt;&lt;y&lt;&lt;endl;
            res++;
            book[x][y]=1;
            for(int i=0;i&lt;4;i++)
            {
                int nx=x+dx[i],ny=dy[i]+y;
                if(nx&lt;0 || nx&gt;=rows || ny&lt;0 || ny &gt;=cols) continue;
                //if(nx==0) cout&lt;&lt;ny&lt;&lt;endl;
                q.push({nx,ny});
            }
        }
        return res;
        
    }
    
    int getsum(int x)
    {
        int res=0;
        while(x)
        {
            res+=(x%10);
            x/=10;
        }
        return res;
    }
};
</code></pre></td></tr></table>
</div>
</div><h1 id="剪绳子">剪绳子</h1>
<h2 id="题意-1">题意</h2>
<p>​		一段长度为n的绳子，剪成m段，求它的最大乘积。</p>
<h2 id="思路">思路：</h2>
<p>​		小学数奥题。结论：</p>
<pre><code>    * 整数为n，尽量把n拆分尽量多的3。
	* 剩下一个2，就拆分出一个2.剩下2个2，就拆分出2个2.
	* %3==1的话，拆出来2*2
	* %3==2的话，拆出来2
</code></pre>
<h2 id="证明">证明：</h2>
<blockquote>
<p>假设拆出来的数&gt;=5,那我们拆出一个3 ，（n-3） 那么推出拆出来的俩个数的价值比这个数大，所以，最优解没有&gt;=5的数</p>
<p>假设拆出来的数==4 ，可以看成2*2</p>
<p>假设拆出来的数==1，拆出来的1并不会把乘积变大</p>
<p>最优解里有俩个2，因为3个2 ：2*2 *2 &lt; 3 * 3</p>
<p>综上：结论，里面有一堆3和（1个2｜｜2个2）</p>
<p>n%3==0 ：没有2</p>
<p>n%3==1:   有2个2</p>
<p>n%3 ==2 ：有1个2</p>
</blockquote>
<h2 id="代码">代码</h2>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre class="chroma"><code><span class="lnt"> 1
</span><span class="lnt"> 2
</span><span class="lnt"> 3
</span><span class="lnt"> 4
</span><span class="lnt"> 5
</span><span class="lnt"> 6
</span><span class="lnt"> 7
</span><span class="lnt"> 8
</span><span class="lnt"> 9
</span><span class="lnt">10
</span><span class="lnt">11
</span><span class="lnt">12
</span><span class="lnt">13
</span><span class="lnt">14
</span><span class="lnt">15
</span></code></pre></td>
<td class="lntd">
<pre class="chroma"><code class="language-cpp" data-lang="cpp"><span class="k">class</span> <span class="nc">Solution</span> <span class="p">{</span>
<span class="k">public</span><span class="o">:</span>
    <span class="kt">int</span> <span class="n">maxProductAfterCutting</span><span class="p">(</span><span class="kt">int</span> <span class="n">length</span><span class="p">)</span> <span class="p">{</span>
        <span class="kt">int</span> <span class="n">res</span><span class="o">=</span><span class="mi">1</span><span class="p">;</span>
        <span class="k">if</span><span class="p">(</span><span class="n">length</span><span class="o">&lt;=</span><span class="mi">3</span><span class="p">)</span> <span class="n">res</span><span class="o">=</span><span class="mi">1</span><span class="o">*</span><span class="p">(</span><span class="n">length</span><span class="o">-</span><span class="mi">1</span><span class="p">),</span><span class="n">length</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span>
        <span class="k">else</span> <span class="nf">if</span><span class="p">(</span><span class="n">length</span><span class="o">%</span><span class="mi">3</span> <span class="o">==</span><span class="mi">1</span><span class="p">)</span> <span class="n">res</span><span class="o">*=</span><span class="mi">4</span><span class="p">,</span><span class="n">length</span><span class="o">-=</span><span class="mi">4</span><span class="p">;</span>
        <span class="k">else</span> <span class="nf">if</span><span class="p">(</span><span class="n">length</span><span class="o">%</span><span class="mi">3</span> <span class="o">==</span> <span class="mi">2</span><span class="p">)</span> <span class="n">res</span><span class="o">*=</span><span class="mi">2</span> <span class="p">,</span> <span class="n">length</span><span class="o">-=</span><span class="mi">2</span><span class="p">;</span>
        <span class="k">while</span><span class="p">(</span><span class="n">length</span><span class="p">)</span>
        <span class="p">{</span>
            <span class="n">res</span><span class="o">*=</span><span class="mi">3</span><span class="p">;</span>
            <span class="n">length</span><span class="o">-=</span><span class="mi">3</span><span class="p">;</span>
        <span class="p">}</span>
        <span class="k">return</span> <span class="n">res</span><span class="p">;</span>
    <span class="p">}</span>
<span class="p">};</span>
</code></pre></td></tr></table>
</div>
</div><h1 id="二进制中1的个数">二进制中1的个数</h1>
<h2 id="代码-1">代码</h2>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre class="chroma"><code><span class="lnt">1
</span><span class="lnt">2
</span><span class="lnt">3
</span><span class="lnt">4
</span><span class="lnt">5
</span><span class="lnt">6
</span><span class="lnt">7
</span><span class="lnt">8
</span><span class="lnt">9
</span></code></pre></td>
<td class="lntd">
<pre class="chroma"><code class="language-cpp" data-lang="cpp"><span class="k">class</span> <span class="nc">Solution</span> <span class="p">{</span>
<span class="k">public</span><span class="o">:</span>
    <span class="kt">int</span> <span class="n">NumberOf1</span><span class="p">(</span><span class="kt">int</span> <span class="n">n</span><span class="p">)</span> <span class="p">{</span>
        <span class="kt">int</span> <span class="n">res</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span>
        <span class="k">for</span><span class="p">(</span><span class="kt">int</span> <span class="n">i</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span><span class="n">i</span><span class="o">&lt;</span><span class="mi">32</span><span class="p">;</span><span class="n">i</span><span class="o">++</span><span class="p">)</span>
            <span class="k">if</span><span class="p">(</span><span class="n">n</span><span class="o">&gt;&gt;</span><span class="n">i</span><span class="o">&amp;</span><span class="mi">1</span><span class="p">)</span> <span class="n">res</span><span class="o">++</span><span class="p">;</span>
        <span class="k">return</span> <span class="n">res</span><span class="p">;</span>
    <span class="p">}</span>
<span class="p">};</span>
</code></pre></td></tr></table>
</div>
</div><h1 id="数值的整数次方">数值的整数次方</h1>
<h2 id="思路-1">思路：</h2>
<p>​		快速幂+注意正负数</p>
<h2 id="代码-2">代码：</h2>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre class="chroma"><code><span class="lnt"> 1
</span><span class="lnt"> 2
</span><span class="lnt"> 3
</span><span class="lnt"> 4
</span><span class="lnt"> 5
</span><span class="lnt"> 6
</span><span class="lnt"> 7
</span><span class="lnt"> 8
</span><span class="lnt"> 9
</span><span class="lnt">10
</span><span class="lnt">11
</span><span class="lnt">12
</span><span class="lnt">13
</span><span class="lnt">14
</span><span class="lnt">15
</span><span class="lnt">16
</span><span class="lnt">17
</span><span class="lnt">18
</span></code></pre></td>
<td class="lntd">
<pre class="chroma"><code class="language-cpp" data-lang="cpp"><span class="k">class</span> <span class="nc">Solution</span> <span class="p">{</span>
<span class="k">public</span><span class="o">:</span>
    <span class="kt">double</span> <span class="n">Power</span><span class="p">(</span><span class="kt">double</span> <span class="n">base</span><span class="p">,</span> <span class="kt">int</span> <span class="n">exponent</span><span class="p">)</span> <span class="p">{</span>
        <span class="kt">double</span> <span class="n">res</span><span class="o">=</span><span class="mi">1</span><span class="p">;</span>
        <span class="k">typedef</span> <span class="kt">long</span> <span class="kt">long</span> <span class="n">ll</span><span class="p">;</span>
        <span class="n">ll</span> <span class="n">b</span><span class="o">=</span><span class="n">abs</span><span class="p">(</span><span class="n">ll</span><span class="p">(</span><span class="n">exponent</span><span class="p">));</span>
        <span class="k">while</span><span class="p">(</span><span class="n">b</span><span class="p">)</span>
        <span class="p">{</span>
            <span class="k">if</span><span class="p">(</span><span class="n">b</span><span class="o">&amp;</span><span class="mi">1</span><span class="p">)</span> <span class="n">res</span> <span class="o">=</span> <span class="n">res</span><span class="o">*</span><span class="n">base</span><span class="p">;</span>
            <span class="n">base</span> <span class="o">=</span><span class="n">base</span> <span class="o">*</span><span class="n">base</span><span class="p">;</span>
            <span class="n">b</span><span class="o">&gt;&gt;=</span><span class="mi">1</span><span class="p">;</span>
        <span class="p">}</span>
        
        
        <span class="k">if</span><span class="p">(</span><span class="n">exponent</span><span class="o">&lt;</span><span class="mi">0</span><span class="p">)</span> <span class="n">res</span><span class="o">=</span><span class="mi">1</span><span class="o">/</span><span class="n">res</span><span class="p">;</span>
        <span class="k">return</span> <span class="n">res</span><span class="p">;</span>
    <span class="p">}</span>
<span class="p">};</span>
</code></pre></td></tr></table>
</div>
</div><h1 id="o1时间删除链表节点">O(1)时间删除链表节点</h1>
<h2 id="思路-2">思路；</h2>
<p>​		取巧的做法，并不是真的删除,而是把这个节点用下一个节点覆盖掉，然后把下一个节点的指针处理一下。</p>
<h2 id="代码-3">代码：</h2>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre class="chroma"><code><span class="lnt"> 1
</span><span class="lnt"> 2
</span><span class="lnt"> 3
</span><span class="lnt"> 4
</span><span class="lnt"> 5
</span><span class="lnt"> 6
</span><span class="lnt"> 7
</span><span class="lnt"> 8
</span><span class="lnt"> 9
</span><span class="lnt">10
</span><span class="lnt">11
</span><span class="lnt">12
</span><span class="lnt">13
</span><span class="lnt">14
</span><span class="lnt">15
</span></code></pre></td>
<td class="lntd">
<pre class="chroma"><code class="language-cpp" data-lang="cpp"><span class="cm">/**
</span><span class="cm"> * Definition for singly-linked list.
</span><span class="cm"> * struct ListNode {
</span><span class="cm"> *     int val;
</span><span class="cm"> *     ListNode *next;
</span><span class="cm"> *     ListNode(int x) : val(x), next(NULL) {}
</span><span class="cm"> * };
</span><span class="cm"> */</span>
<span class="k">class</span> <span class="nc">Solution</span> <span class="p">{</span>
<span class="k">public</span><span class="o">:</span>
    <span class="kt">void</span> <span class="n">deleteNode</span><span class="p">(</span><span class="n">ListNode</span><span class="o">*</span> <span class="n">node</span><span class="p">)</span> <span class="p">{</span>
        <span class="n">node</span><span class="o">-&gt;</span><span class="n">val</span><span class="o">=</span><span class="n">node</span><span class="o">-&gt;</span><span class="n">next</span><span class="o">-&gt;</span><span class="n">val</span><span class="p">;</span>
        <span class="n">node</span><span class="o">-&gt;</span><span class="n">next</span><span class="o">=</span><span class="n">node</span><span class="o">-&gt;</span><span class="n">next</span><span class="o">-&gt;</span><span class="n">next</span><span class="p">;</span>
    <span class="p">}</span>
<span class="p">};</span>
</code></pre></td></tr></table>
</div>
</div><h1 id="删除链表中重复的节点">删除链表中重复的节点</h1>
<h2 id="思路-3">思路：</h2>
<blockquote>
<p>建立一个新链表（最终要返回这个链表），这个链表头节点为-1（标记）</p>
<p>建立一个新链表的节点q</p>
<p>然后用while操作，因为是有序链表</p>
<p>注意：但凡节点重复，这些节点都删去，不保留</p>
</blockquote>
<h2 id="代码-4">代码</h2>
<blockquote>
<p>p代表上一个保留的节点</p>
<p>q代表下一段的最后一个节点</p>
<p>temp 新的链表，在原来链表之前添加-1</p>
<p>遍历这个新链表，每次看下一段的长度，用q</p>
<p>​		下一段长度为1:p-&gt;next-&gt;next =q</p>
<p>​		下一段长度不为1:</p>
</blockquote>
<blockquote>
</blockquote>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre class="chroma"><code><span class="lnt"> 1
</span><span class="lnt"> 2
</span><span class="lnt"> 3
</span><span class="lnt"> 4
</span><span class="lnt"> 5
</span><span class="lnt"> 6
</span><span class="lnt"> 7
</span><span class="lnt"> 8
</span><span class="lnt"> 9
</span><span class="lnt">10
</span><span class="lnt">11
</span><span class="lnt">12
</span><span class="lnt">13
</span><span class="lnt">14
</span><span class="lnt">15
</span><span class="lnt">16
</span><span class="lnt">17
</span><span class="lnt">18
</span><span class="lnt">19
</span><span class="lnt">20
</span><span class="lnt">21
</span><span class="lnt">22
</span><span class="lnt">23
</span><span class="lnt">24
</span></code></pre></td>
<td class="lntd">
<pre class="chroma"><code class="language-cpp" data-lang="cpp"><span class="cm">/**
</span><span class="cm"> * Definition for singly-linked list.
</span><span class="cm"> * struct ListNode {
</span><span class="cm"> *     int val;
</span><span class="cm"> *     ListNode *next;
</span><span class="cm"> *     ListNode(int x) : val(x), next(NULL) {}
</span><span class="cm"> * };
</span><span class="cm"> */</span>
<span class="k">class</span> <span class="nc">Solution</span> <span class="p">{</span>
<span class="k">public</span><span class="o">:</span>
    <span class="n">ListNode</span><span class="o">*</span> <span class="n">deleteDuplication</span><span class="p">(</span><span class="n">ListNode</span><span class="o">*</span> <span class="n">head</span><span class="p">)</span> <span class="p">{</span>
        <span class="n">ListNode</span> <span class="o">*</span> <span class="n">temp</span><span class="o">=</span><span class="k">new</span> <span class="n">ListNode</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">);</span>
        <span class="k">auto</span> <span class="n">p</span><span class="o">=</span><span class="n">temp</span><span class="p">;</span>
        <span class="n">temp</span><span class="o">-&gt;</span><span class="n">next</span><span class="o">=</span><span class="n">head</span><span class="p">;</span>
        <span class="k">while</span><span class="p">(</span><span class="n">p</span><span class="o">-&gt;</span><span class="n">next</span><span class="p">)</span>
        <span class="p">{</span>
            <span class="k">auto</span> <span class="n">q</span><span class="o">=</span><span class="n">p</span><span class="o">-&gt;</span><span class="n">next</span><span class="p">;</span>
            <span class="k">while</span><span class="p">(</span><span class="n">q</span> <span class="o">&amp;&amp;</span> <span class="n">p</span><span class="o">-&gt;</span><span class="n">next</span><span class="o">-&gt;</span><span class="n">val</span> <span class="o">==</span> <span class="n">q</span><span class="o">-&gt;</span><span class="n">val</span><span class="p">)</span> <span class="n">q</span><span class="o">=</span><span class="n">q</span><span class="o">-&gt;</span><span class="n">next</span><span class="p">;</span>
            <span class="k">if</span><span class="p">(</span><span class="n">p</span><span class="o">-&gt;</span><span class="n">next</span><span class="o">-&gt;</span><span class="n">next</span> <span class="o">==</span> <span class="n">q</span><span class="p">)</span> <span class="n">p</span><span class="o">=</span><span class="n">p</span><span class="o">-&gt;</span><span class="n">next</span><span class="p">;</span>
            <span class="k">else</span> <span class="n">p</span><span class="o">-&gt;</span><span class="n">next</span> <span class="o">=</span> <span class="n">q</span><span class="p">;</span>
        <span class="p">}</span>
        <span class="k">return</span> <span class="n">temp</span><span class="o">-&gt;</span><span class="n">next</span><span class="p">;</span>
    <span class="p">}</span>
<span class="p">};</span>
</code></pre></td></tr></table>
</div>
</div><h1 id="正则表达式匹配">正则表达式匹配</h1>
<h2 id="题意-2">题意：</h2>
<p><img src="https://tva1.sinaimg.cn/large/007S8ZIlly1ghlm7qnve3j31960m0wi7.jpg" alt="image-20200810124341115"></p>
<h2 id="思路-4">思路</h2>
<p>​		比较难的动态规划，俩个串是不是匹配：二维动态规划：f[i ] [j ] :</p>
<p>​		状态转移：</p>
<ul>
<li>pj是正常字符</li>
<li>pj是“.”的话</li>
<li>pj+1是‘*’的话//表示a *
<ul>
<li>表示0次：f[i] [j] = f [i ] [j+2]</li>
<li>表示1次：f[i] [j] = f[i+1] [j] ：i那里出现1次，i之和没有出现：f[i+1] [j]</li>
</ul>
</li>
</ul>
<h2 id="写法">写法</h2>
<ul>
<li>下标先从1开始整</li>
<li>要知道，s0可以和p1｜｜p2 有可能匹配，所以for循环i从0开始</li>
<li>先处理“a*”这类的，先跳过，之后的循环看“ * ”</li>
<li>接下来的情况分为是不是“*”
<ul>
<li>不是“*”</li>
<li>是“*”</li>
</ul>
</li>
</ul>
<h2 id="代码-5">代码</h2>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre class="chroma"><code><span class="lnt"> 1
</span><span class="lnt"> 2
</span><span class="lnt"> 3
</span><span class="lnt"> 4
</span><span class="lnt"> 5
</span><span class="lnt"> 6
</span><span class="lnt"> 7
</span><span class="lnt"> 8
</span><span class="lnt"> 9
</span><span class="lnt">10
</span><span class="lnt">11
</span><span class="lnt">12
</span><span class="lnt">13
</span><span class="lnt">14
</span><span class="lnt">15
</span><span class="lnt">16
</span><span class="lnt">17
</span><span class="lnt">18
</span><span class="lnt">19
</span><span class="lnt">20
</span><span class="lnt">21
</span><span class="lnt">22
</span><span class="lnt">23
</span><span class="lnt">24
</span><span class="lnt">25
</span><span class="lnt">26
</span><span class="lnt">27
</span><span class="lnt">28
</span><span class="lnt">29
</span><span class="lnt">30
</span><span class="lnt">31
</span><span class="lnt">32
</span><span class="lnt">33
</span><span class="lnt">34
</span></code></pre></td>
<td class="lntd">
<pre class="chroma"><code class="language-cpp" data-lang="cpp"><span class="k">class</span> <span class="nc">Solution</span> <span class="p">{</span>
<span class="k">public</span><span class="o">:</span>
    <span class="n">vector</span><span class="o">&lt;</span><span class="n">vector</span><span class="o">&lt;</span><span class="kt">int</span><span class="o">&gt;&gt;</span><span class="n">f</span><span class="p">;</span>
    <span class="kt">int</span> <span class="n">n</span><span class="p">,</span> <span class="n">m</span><span class="p">;</span>
    <span class="kt">bool</span> <span class="nf">isMatch</span><span class="p">(</span><span class="n">string</span> <span class="n">s</span><span class="p">,</span> <span class="n">string</span> <span class="n">p</span><span class="p">)</span> <span class="p">{</span>
        <span class="n">n</span> <span class="o">=</span> <span class="n">s</span><span class="p">.</span><span class="n">size</span><span class="p">();</span>
        <span class="n">m</span> <span class="o">=</span> <span class="n">p</span><span class="p">.</span><span class="n">size</span><span class="p">();</span>
        <span class="n">f</span> <span class="o">=</span> <span class="n">vector</span><span class="o">&lt;</span><span class="n">vector</span><span class="o">&lt;</span><span class="kt">int</span><span class="o">&gt;&gt;</span><span class="p">(</span><span class="n">n</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="n">vector</span><span class="o">&lt;</span><span class="kt">int</span><span class="o">&gt;</span><span class="p">(</span><span class="n">m</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">));</span>
        <span class="k">return</span> <span class="n">dp</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">s</span><span class="p">,</span> <span class="n">p</span><span class="p">);</span>
    <span class="p">}</span>

    <span class="kt">bool</span> <span class="nf">dp</span><span class="p">(</span><span class="kt">int</span> <span class="n">x</span><span class="p">,</span> <span class="kt">int</span> <span class="n">y</span><span class="p">,</span> <span class="n">string</span> <span class="o">&amp;</span><span class="n">s</span><span class="p">,</span> <span class="n">string</span> <span class="o">&amp;</span><span class="n">p</span><span class="p">)</span>
    <span class="p">{</span>
        <span class="k">if</span> <span class="p">(</span><span class="n">f</span><span class="p">[</span><span class="n">x</span><span class="p">][</span><span class="n">y</span><span class="p">]</span> <span class="o">!=</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span> <span class="k">return</span> <span class="n">f</span><span class="p">[</span><span class="n">x</span><span class="p">][</span><span class="n">y</span><span class="p">];</span>
        <span class="k">if</span> <span class="p">(</span><span class="n">y</span> <span class="o">==</span> <span class="n">m</span><span class="p">)</span>
            <span class="k">return</span> <span class="n">f</span><span class="p">[</span><span class="n">x</span><span class="p">][</span><span class="n">y</span><span class="p">]</span> <span class="o">=</span> <span class="n">x</span> <span class="o">==</span> <span class="n">n</span><span class="p">;</span>
        <span class="c1">//s: s[x]
</span><span class="c1"></span>        <span class="c1">//p: p[y]
</span><span class="c1"></span>        <span class="kt">bool</span> <span class="n">first_match</span> <span class="o">=</span> <span class="n">x</span> <span class="o">&lt;</span> <span class="n">n</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="n">s</span><span class="p">[</span><span class="n">x</span><span class="p">]</span> <span class="o">==</span> <span class="n">p</span><span class="p">[</span><span class="n">y</span><span class="p">]</span> <span class="o">||</span> <span class="n">p</span><span class="p">[</span><span class="n">y</span><span class="p">]</span> <span class="o">==</span> <span class="sc">&#39;.&#39;</span><span class="p">);</span>
        <span class="kt">bool</span> <span class="n">ans</span><span class="p">;</span>
        <span class="c1">// 若是p[y+1]是*的话
</span><span class="c1"></span>        <span class="k">if</span> <span class="p">(</span><span class="n">y</span> <span class="o">+</span> <span class="mi">1</span> <span class="o">&lt;</span> <span class="n">m</span> <span class="o">&amp;&amp;</span> <span class="n">p</span><span class="p">[</span><span class="n">y</span> <span class="o">+</span> <span class="mi">1</span><span class="p">]</span> <span class="o">==</span> <span class="sc">&#39;*&#39;</span><span class="p">)</span>
        <span class="p">{</span>
            <span class="n">ans</span> <span class="o">=</span> <span class="n">dp</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span> <span class="o">+</span> <span class="mi">2</span><span class="p">,</span> <span class="n">s</span><span class="p">,</span> <span class="n">p</span><span class="p">)</span> <span class="o">||</span> <span class="n">first_match</span> <span class="o">&amp;&amp;</span> <span class="n">dp</span><span class="p">(</span><span class="n">x</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">s</span><span class="p">,</span> <span class="n">p</span><span class="p">);</span>
        <span class="p">}</span>
        <span class="k">else</span>
            <span class="n">ans</span> <span class="o">=</span> <span class="n">first_match</span> <span class="o">&amp;&amp;</span> <span class="n">dp</span><span class="p">(</span><span class="n">x</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="n">y</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="n">s</span><span class="p">,</span> <span class="n">p</span><span class="p">);</span>
            
        
        <span class="k">return</span> <span class="n">f</span><span class="p">[</span><span class="n">x</span><span class="p">][</span><span class="n">y</span><span class="p">]</span> <span class="o">=</span> <span class="n">ans</span><span class="p">;</span>
    <span class="p">}</span>
<span class="p">};</span>


</code></pre></td></tr></table>
</div>
</div><h1 id="调整数组顺序使奇数位于偶数前面">调整数组顺序使奇数位于偶数前面</h1>
<h2 id="代码直接用i-j指针while">代码:直接用i ，j指针+while</h2>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre class="chroma"><code><span class="lnt"> 1
</span><span class="lnt"> 2
</span><span class="lnt"> 3
</span><span class="lnt"> 4
</span><span class="lnt"> 5
</span><span class="lnt"> 6
</span><span class="lnt"> 7
</span><span class="lnt"> 8
</span><span class="lnt"> 9
</span><span class="lnt">10
</span><span class="lnt">11
</span><span class="lnt">12
</span></code></pre></td>
<td class="lntd">
<pre class="chroma"><code class="language-cpp" data-lang="cpp"><span class="k">class</span> <span class="nc">Solution</span> <span class="p">{</span>
<span class="k">public</span><span class="o">:</span>
    <span class="kt">void</span> <span class="n">reOrderArray</span><span class="p">(</span><span class="n">vector</span><span class="o">&lt;</span><span class="kt">int</span><span class="o">&gt;</span> <span class="o">&amp;</span><span class="n">array</span><span class="p">)</span> <span class="p">{</span>
         <span class="kt">int</span> <span class="n">i</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span><span class="n">j</span><span class="o">=</span><span class="n">array</span><span class="p">.</span><span class="n">size</span><span class="p">()</span><span class="o">-</span><span class="mi">1</span><span class="p">;</span>
         <span class="k">while</span><span class="p">(</span><span class="n">i</span><span class="o">&lt;</span><span class="n">j</span><span class="p">)</span>
         <span class="p">{</span>
             <span class="k">while</span><span class="p">(</span><span class="n">i</span><span class="o">&lt;</span><span class="n">j</span> <span class="o">&amp;&amp;</span> <span class="n">array</span><span class="p">[</span><span class="n">i</span><span class="p">]</span><span class="o">%</span><span class="mi">2</span><span class="p">)</span> <span class="n">i</span><span class="o">++</span><span class="p">;</span>
             <span class="k">while</span><span class="p">(</span><span class="n">i</span><span class="o">&lt;</span><span class="n">j</span> <span class="o">&amp;&amp;</span> <span class="n">array</span><span class="p">[</span><span class="n">j</span><span class="p">]</span><span class="o">%</span><span class="mi">2</span><span class="o">==</span><span class="mi">0</span><span class="p">)</span> <span class="n">j</span><span class="o">--</span><span class="p">;</span>
             <span class="k">if</span><span class="p">(</span><span class="n">i</span><span class="o">&lt;</span><span class="n">j</span><span class="p">)</span> <span class="n">swap</span><span class="p">(</span><span class="n">array</span><span class="p">[</span><span class="n">i</span><span class="p">],</span><span class="n">array</span><span class="p">[</span><span class="n">j</span><span class="p">]);</span>
         <span class="p">}</span>
    <span class="p">}</span>
<span class="p">};</span>
</code></pre></td></tr></table>
</div>
</div><h1 id="链表中倒数第k个节点">链表中倒数第k个节点</h1>
<h2 id="代码-6">代码</h2>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre class="chroma"><code><span class="lnt"> 1
</span><span class="lnt"> 2
</span><span class="lnt"> 3
</span><span class="lnt"> 4
</span><span class="lnt"> 5
</span><span class="lnt"> 6
</span><span class="lnt"> 7
</span><span class="lnt"> 8
</span><span class="lnt"> 9
</span><span class="lnt">10
</span><span class="lnt">11
</span><span class="lnt">12
</span><span class="lnt">13
</span><span class="lnt">14
</span><span class="lnt">15
</span><span class="lnt">16
</span><span class="lnt">17
</span><span class="lnt">18
</span><span class="lnt">19
</span><span class="lnt">20
</span></code></pre></td>
<td class="lntd">
<pre class="chroma"><code class="language-cpp" data-lang="cpp"><span class="cm">/**
</span><span class="cm"> * Definition for singly-linked list.
</span><span class="cm"> * struct ListNode {
</span><span class="cm"> *     int val;
</span><span class="cm"> *     ListNode *next;
</span><span class="cm"> *     ListNode(int x) : val(x), next(NULL) {}
</span><span class="cm"> * };
</span><span class="cm"> */</span>
<span class="k">class</span> <span class="nc">Solution</span> <span class="p">{</span>
<span class="k">public</span><span class="o">:</span>
    <span class="n">ListNode</span><span class="o">*</span> <span class="n">findKthToTail</span><span class="p">(</span><span class="n">ListNode</span><span class="o">*</span> <span class="n">pListHead</span><span class="p">,</span> <span class="kt">int</span> <span class="n">k</span><span class="p">)</span> <span class="p">{</span>
        <span class="kt">int</span> <span class="n">n</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span>
        <span class="k">for</span><span class="p">(</span><span class="k">auto</span> <span class="n">p</span><span class="o">=</span><span class="n">pListHead</span><span class="p">;</span><span class="n">p</span><span class="p">;</span><span class="n">p</span><span class="o">=</span><span class="n">p</span><span class="o">-&gt;</span><span class="n">next</span><span class="p">)</span> <span class="n">n</span><span class="o">++</span><span class="p">;</span>
        <span class="k">if</span><span class="p">(</span><span class="n">n</span><span class="o">&lt;</span><span class="n">k</span><span class="p">)</span> <span class="k">return</span> <span class="nb">NULL</span><span class="p">;</span>
        <span class="k">auto</span> <span class="n">p</span><span class="o">=</span><span class="n">pListHead</span><span class="p">;</span>
        <span class="k">for</span><span class="p">(</span><span class="kt">int</span> <span class="n">i</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span><span class="n">i</span><span class="o">&lt;</span><span class="n">n</span><span class="o">-</span><span class="n">k</span><span class="p">;</span><span class="n">i</span><span class="o">++</span><span class="p">)</span>
            <span class="n">p</span><span class="o">=</span><span class="n">p</span><span class="o">-&gt;</span><span class="n">next</span><span class="p">;</span>
        <span class="k">return</span> <span class="n">p</span><span class="p">;</span>
    <span class="p">}</span>
<span class="p">};</span>
</code></pre></td></tr></table>
</div>
</div><h1 id="链表中环的起点">链表中环的起点</h1>
<h2 id="题意-3">题意</h2>
<p><img src="https://tva1.sinaimg.cn/large/007S8ZIlly1ghm49winypj315a0omwjg.jpg" alt="image-20200810230832913"></p>
<h2 id="思路-5">思路</h2>
<p>​		hash也可以，有一个思路比较好的想法：</p>
<p>​		i是慢指针一次走一步，j是块指针一次走俩步，当i与j相遇时候，i到head。然后i，j一次一步，直到相遇。</p>
<h2 id="代码-7">代码</h2>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre class="chroma"><code><span class="lnt"> 1
</span><span class="lnt"> 2
</span><span class="lnt"> 3
</span><span class="lnt"> 4
</span><span class="lnt"> 5
</span><span class="lnt"> 6
</span><span class="lnt"> 7
</span><span class="lnt"> 8
</span><span class="lnt"> 9
</span><span class="lnt">10
</span><span class="lnt">11
</span><span class="lnt">12
</span><span class="lnt">13
</span><span class="lnt">14
</span><span class="lnt">15
</span><span class="lnt">16
</span><span class="lnt">17
</span><span class="lnt">18
</span><span class="lnt">19
</span><span class="lnt">20
</span><span class="lnt">21
</span><span class="lnt">22
</span><span class="lnt">23
</span><span class="lnt">24
</span><span class="lnt">25
</span><span class="lnt">26
</span><span class="lnt">27
</span><span class="lnt">28
</span><span class="lnt">29
</span><span class="lnt">30
</span><span class="lnt">31
</span><span class="lnt">32
</span></code></pre></td>
<td class="lntd">
<pre class="chroma"><code class="language-cpp" data-lang="cpp"><span class="cm">/**
</span><span class="cm"> * Definition for singly-linked list.
</span><span class="cm"> * struct ListNode {
</span><span class="cm"> *     int val;
</span><span class="cm"> *     ListNode *next;
</span><span class="cm"> *     ListNode(int x) : val(x), next(NULL) {}
</span><span class="cm"> * };
</span><span class="cm"> */</span>
<span class="k">class</span> <span class="nc">Solution</span> <span class="p">{</span>
<span class="k">public</span><span class="o">:</span>
    <span class="n">ListNode</span> <span class="o">*</span><span class="n">entryNodeOfLoop</span><span class="p">(</span><span class="n">ListNode</span> <span class="o">*</span><span class="n">head</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">auto</span> <span class="n">i</span><span class="o">=</span><span class="n">head</span><span class="p">,</span><span class="n">j</span><span class="o">=</span><span class="n">head</span><span class="p">;</span>
        <span class="k">while</span><span class="p">(</span><span class="n">i</span><span class="o">&amp;&amp;</span><span class="n">j</span><span class="p">)</span>
        <span class="p">{</span>
            <span class="n">i</span><span class="o">=</span><span class="n">i</span><span class="o">-&gt;</span><span class="n">next</span><span class="p">;</span>
            <span class="n">j</span><span class="o">=</span><span class="n">j</span><span class="o">-&gt;</span><span class="n">next</span><span class="p">;</span>
            <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="n">j</span><span class="p">)</span> <span class="k">return</span> <span class="nb">NULL</span><span class="p">;</span>
            <span class="k">else</span> <span class="n">j</span><span class="o">=</span><span class="n">j</span><span class="o">-&gt;</span><span class="n">next</span><span class="p">;</span>
            <span class="k">if</span><span class="p">(</span><span class="n">i</span><span class="o">==</span><span class="n">j</span><span class="p">)</span>
            <span class="p">{</span>
                <span class="n">i</span><span class="o">=</span><span class="n">head</span><span class="p">;</span>
                <span class="k">while</span><span class="p">(</span><span class="n">i</span><span class="o">!=</span><span class="n">j</span><span class="p">)</span>
                <span class="p">{</span>
                    <span class="n">i</span><span class="o">=</span><span class="n">i</span><span class="o">-&gt;</span><span class="n">next</span><span class="p">;</span>
                    <span class="n">j</span><span class="o">=</span><span class="n">j</span><span class="o">-&gt;</span><span class="n">next</span><span class="p">;</span>
                <span class="p">}</span>
                <span class="k">return</span> <span class="n">i</span><span class="p">;</span>
            <span class="p">}</span>
        <span class="p">}</span>
        <span class="k">return</span> <span class="nb">NULL</span><span class="p">;</span>
    <span class="p">}</span>
<span class="p">};</span>
</code></pre></td></tr></table>
</div>
</div>
    </div>

    <div class="post-copyright">
  <p class="copyright-item">
    <span class="item-title">Author</span>
    <span class="item-content">olOwOlo</span>
  </p>
  <p class="copyright-item">
    <span class="item-title">LastMod</span>
    <span class="item-content">
        2021-06-01
        
    </span>
  </p>
  
  
</div>
<footer class="post-footer">
      <div class="post-tags">
          <a href="/tags/%E5%89%91%E6%8C%87offer/">剑指offer</a>
          </div>
      <nav class="post-nav">
        <a class="prev" href="/post/%E7%AC%AC%E4%B8%89%E5%91%A8/">
            <i class="iconfont icon-left"></i>
            <span class="prev-text nav-default">剑指offer第三周</span>
            <span class="prev-text nav-mobile">Prev</span>
          </a>
        <a class="next" href="/post/%E7%AC%AC%E4%BA%94%E5%91%A8/">
            <span class="next-text nav-default">剑指offer第五周</span>
            <span class="next-text nav-mobile">Next</span>
            <i class="iconfont icon-right"></i>
          </a>
      </nav>
    </footer>
  </article>
        </div>
        

  

  

      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="social-links">
      <a href="mailto:your@email.com" class="iconfont icon-email" title="email"></a>
      <a href="http://localhost:1313" class="iconfont icon-stack-overflow" title="stack-overflow"></a>
      <a href="http://localhost:1313" class="iconfont icon-twitter" title="twitter"></a>
      <a href="http://localhost:1313" class="iconfont icon-facebook" title="facebook"></a>
      <a href="http://localhost:1313" class="iconfont icon-linkedin" title="linkedin"></a>
      <a href="http://localhost:1313" class="iconfont icon-google" title="google"></a>
      <a href="http://localhost:1313" class="iconfont icon-github" title="github"></a>
      <a href="http://localhost:1313" class="iconfont icon-weibo" title="weibo"></a>
      <a href="http://localhost:1313" class="iconfont icon-zhihu" title="zhihu"></a>
      <a href="http://localhost:1313" class="iconfont icon-douban" title="douban"></a>
      <a href="http://localhost:1313" class="iconfont icon-pocket" title="pocket"></a>
      <a href="http://localhost:1313" class="iconfont icon-tumblr" title="tumblr"></a>
      <a href="http://localhost:1313" class="iconfont icon-instagram" title="instagram"></a>
      <a href="http://localhost:1313" class="iconfont icon-gitlab" title="gitlab"></a>
      <a href="http://localhost:1313" class="iconfont icon-bilibili" title="bilibili"></a>
  <a href="https://xiongshou.github.io/index.xml" type="application/rss+xml" class="iconfont icon-rss" title="rss"></a>
</div>

<div class="copyright">
  <span class="power-by">
    Powered by <a class="hexo-link" href="https://gohugo.io">Hugo</a>
  </span>
  <span class="division">|</span>
  <span class="theme-info">
    Theme - 
    <a class="theme-link" href="https://github.com/olOwOlo/hugo-theme-even">Even</a>
  </span>

  

  <span class="copyright-year">
    &copy; 
    2017 - 
    2021<span class="heart"><i class="iconfont icon-heart"></i></span><span>olOwOlo</span>
  </span>
</div>

    </footer>

    <div class="back-to-top" id="back-to-top">
      <i class="iconfont icon-up"></i>
    </div>
  </div>
  
  <script src="https://cdn.jsdelivr.net/npm/jquery@3.2.1/dist/jquery.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
  <script src="https://cdn.jsdelivr.net/npm/slideout@1.0.1/dist/slideout.min.js" integrity="sha256-t+zJ/g8/KXIJMjSVQdnibt4dlaDxc9zXr/9oNPeWqdg=" crossorigin="anonymous"></script>
  <script src="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.1.20/dist/jquery.fancybox.min.js" integrity="sha256-XVLffZaxoWfGUEbdzuLi7pwaUJv1cecsQJQqGLe7axY=" crossorigin="anonymous"></script>



<script type="text/javascript" src="/js/main.min.c99b103c33d1539acf3025e1913697534542c4a5aa5af0ccc20475ed2863603b.js"></script>








</body>
</html>
